FSM function name:
    f_arg

Parameters:
    

Module header:
    

Global initialization:
    #include "mapa_bit.h"
    #include "tipos.h"
    
    // Tiempo de espera para entrar en el modo impulsional y Tiempo de seguridad
    #define TIMEms(t) ((t)/5)
    #define DELAYms(t) (arg_DELAY_MAX - TIMEms((t)))
    #define arg_DELAY_MAX TIMEms(10000) // 10s
    #define arg_tmrStart() {arg_timer = arg_DELAY_MAX;}
    #define arg_T_Impuls DELAYms(400)
    #define arg_T_Pulse DELAYms(30)
    #define arg_T_Protec 0 // DELAYms(arg_DELAY_MAX)
    #define arg_tmrEnd(t) (arg_timer <= (t))
    #define arg_tmrStep() {if(arg_timer > 0){ arg_timer--;}}
    
    // Variables del módulo
    static tipoTimer16 arg_timer;

Function header:
    

Global actions (before FSM analysis):
    // Preprocesos
    bl.ARG_O = bi.PR_ARG_O ¦¦ (bi.PL_ARG_O && bi.I_CONDA && (!bi.PR_ARG_F));
    bl.ARG_F = bi.PR_ARG_F ¦¦ (bi.PL_ARG_F && bi.I_CONDA && (!bi.PR_ARG_O));
    
    // Avanza el reloj
    arg_tmrStep();

Global actions (after FSM analysis):
    

Global final (out of FSM function):
    

Links: